from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from .routers import api_v1


application = FastAPI()

application.add_middleware(
    CORSMiddleware,
    allow_origins=["*"],  # Adjust this to your needs
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

# 添加健康检查端点
@application.get("/health")
async def health_check():
    return {"status": "healthy"}

application.include_router(api_v1, prefix="/api/v1", tags=["api"])


if __name__ == "__main__":
    import uvicorn

    uvicorn.run(application, host="0.0.0.0", port=18000)
    ...
